package com.ztgf.order.models.service;

import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.IService;
import com.ztgf.common.constant.Result;
import com.ztgf.order.models.bo.*;
import com.ztgf.order.models.dto.OrderReturnCommodityDTO;
import com.ztgf.order.models.vo.OrderReturnCommodityAdminListVO;
import com.ztgf.order.models.vo.OrderReturnCommodityDetailsVO;
import com.ztgf.order.models.vo.OrderReturnCommodityListVO;
import com.ztgf.order.models.vo.OrderUpdateAfterSaleDetailsVO;

import java.util.List;

/**
 * @author: chenyu.wang
 * date: 2020-06-30 10:31
 * Description:订单退换货表服务
 */
public interface IOrderReturnCommodityService extends IService<OrderReturnCommodityDTO> {


    Result<List<String>> add(OrderReturnCommoditySaveBO saveBO);

    Result<List<String>> updateIsCancel(Long id);

    Result<List<String>> updateAuditState(Long id, Integer type);

    Result<List<String>> updateSendMeg(OrderReturnCommodityUpdateBO updateBO);

//    Result<List<String>> updateSignFo(Long id);

    /**
     * 卖家退款签收
     * @return
     */
    void saveReceive(OrderReturnCommodityDTO dto);
    //卖家换货签收
    boolean SellerSignForReturn(OrderReturnCommodityDTO dto);

    Result updateBuyersSignFo(Long id);

    Result<List<String>> updateInterventionState(Long id);

    Result<List<String>> updateInterventionDeal(OrderReturnCommodityUpdateBO updateBO);

    Result<List<String>> updateIsState(Long id, Integer isState, Integer type);

    Page<OrderReturnCommodityListVO> queryPageList(OrderReturnCommodityListBO bo);

    OrderReturnCommodityDetailsVO getDetailsById(Long id);

    Page<OrderReturnCommodityAdminListVO> queryAdminPageList(OrderReturnCommodityAdminBO bo);

    Integer getAfterOrderNumber();

    /**
     * @Description: 平台协调后判定输赢
     * @Author: WangChenYu
     * @Param: [id(售后订单id), state(1买赢,2卖赢), context(凭证)]
     * @Date: 2020-10-12 10:12
     */
    Result<List<String>> updateConsortState(Long id, Integer state, String context);

    Integer getMyAfterSalesNum(Long buyerShopId, Integer type);

    /**
     * @Description: 修改售后信息
     * @Author: chenyu.wang
     * @Params: [updateBo]
     * @Date: 2020.11.16 09:46
     */
    Result updateOrderAfterSale(OrderAfterSaleUpdateBO updateBo);

    /**
     * @Description: 根据售后订单id查询售后修改信息
     * @Author: chenyu.wang
     * @Params: [id]
     * @Date: 2020.11.23 14:59
     */
    OrderUpdateAfterSaleDetailsVO getUpdateOrderAfterSaleById(Long id);

    /**
     * @Description: 获取店铺信息页待处理售后数量
     * @Author: chenyu.wang
     * @Params: [shopId]
     * @Date: 2020.12.02 09:47
     */
    Integer afterSalesQuantityToBeProcessed(Long shopId);

    /**
     * @return : boolean
     * @Author :chenyu.wang
     * @Description : 查询订单是否存在售后
     * @Date : 2021.03.19 15:24
     * @Param : [orderId]
     **/
    boolean checkWhetherTheOrderHasAfterSales(Long orderId);
}
